package cn.tedu.csmall.product.pojo.param;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

@Data
public class CategoryAddNewParam implements Serializable {

    @NotNull(message = "添加失败，分类名称必须提交")
    @ApiModelProperty(value = "类别名称",required = true,example = "电脑")
    private String name;

    @Range(min = 1,message = "添加失败,上级id必须为正数")
    @ApiModelProperty(value = "上级分类ID(必须为正数)",required = true,example = "4")
    private Long parentId;


    @ApiModelProperty(value = "关键词",required = true,example = "k1,k2")
    private String keywords;

    @NotNull(message = "sort必须提交")
    @Range(min = 1,max = 99,message = "sort必须在0~99之间")
    @ApiModelProperty(value = "排序序号(必须在0~99之间)",required = true,example = "50")
    private Integer sort;

    @ApiModelProperty(value = "图标地址",required = true,example = "http://www.baidu.com")
    private String icon;

    @NotNull(message = "enable必须提交")
    @Range(max = 1,message = "enable必须在0~1之间")
    @ApiModelProperty(value = "是否有效",required = true,example = "1")
    private Integer enable;

    @NotNull(message = "isDisplay必须提交")
    @Range(max = 1,message = "isDisplay必须在0~1之间")
    @ApiModelProperty(value = "是否显示",required = true,example = "1")
    private Integer isDisplay;
}
